03 / 12

What tags are used to embed videos and audios?

Embedding Video and Audio in HTML

In HTML, you can embed multimedia using the <video> and <audio> elements. These allow you to play video and audio directly in the browser without external plugins.

Key Points about <video>
  1. 1

    The <video> tag is used for embedding video files.

  2. 2

    Supports attributes like controls, autoplay, loop, muted, and poster.

  3. 3

    Formats commonly supported: MP4, WebM, and Ogg.

  4. 4

    You can provide multiple formats using <source> for better browser compatibility.

Key Points about <audio>
  1. 1

    The <audio> tag is used for embedding audio files.

  2. 2

    Supports attributes like controls, autoplay, loop, and muted.

  3. 3

    Formats commonly supported: MP3, OGG, and WAV.

  4. 4

    You can provide multiple formats using <source> just like with <video>.

Example Usage

In short: Use <video> to embed videos and <audio> to embed sounds or music directly in your web pages.